<template>
  <div class="app-container">
    <el-button type="success" class="sq" @click="goau">点击授权</el-button>
  </div>
</template>
<script>
import {getAuthUrl} from "@/api/login";

export default {
  data() {
    return {
      options: [{
        value: '选项1',
        label: '黄金糕'
      }, {
        value: '选项2',
        label: '双皮奶'
      }, {
        value: '选项3',
        label: '蚵仔煎'
      }, {
        value: '选项4',
        label: '龙须面'
      }, {
        value: '选项5',
        label: '北京烤鸭'
      }],
      total: 0,
      form: {
        f1: '',
        f2: ''
      },
      listQuery: {
        a1: '',
        a2: '',
        pageNum: 1,
        pageSize: 10
      },
      options1: [
        {
          value: '1',
          label: '座位锁定'
        },
        {
          value: '2',
          label: '航班'
        }
      ],
      pickerOptions: {
        shortcuts: [{
          text: '最近一周',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 7)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近一个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 30)
            picker.$emit('pick', [start, end])
          }
        }, {
          text: '最近三个月',
          onClick(picker) {
            const end = new Date()
            const start = new Date()
            start.setTime(start.getTime() - 3600 * 1000 * 24 * 90)
            picker.$emit('pick', [start, end])
          }
        }]
      },
      queryLoading: false,
      listLoading: false,
      exportLoading: false,
      list: [
        {
          a1: 1
        }
      ],
      date: [],
      selectList: [],
      type: '',
      dialogVisible: false
    }
  },
  mounted() {
  },
  methods: {
    goau() {
      getAuthUrl().then(res => {
        window.location.href = res.msg
      })

    },
    handleSubmit() {
      this.handleClose()
    },
    handleClose() {
      this.dialogVisible = false
      this.clearForm()
    },
    clearForm() {
      this.form = {
        f1: '',
        f2: ''
      }
    },
    deleteDetail(n) {
      this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.$message({
          type: 'success',
          message: '删除成功!'
        })
      }).catch(() => {
        this.$message({
          type: 'info',
          message: '已取消删除'
        })
      })
    },
    showDetail(t) {
      this.dialogVisible = true
      this.type = t
      if (t === 'add') {
        console.log('add')
      } else if (t === 'edit') {
        console.log('edit')
      }
    },
    selectTableData(n) {
      console.log(n, '============selection========')
      this.selectList = n.map(v => v.id)
    },
    getList() {

    },
    clickClear() {
      this.listQuery = {
        a1: '',
        a2: '',
        pageNum: 1,
        pageSize: 10
      }
    },
    clickQuery() {
      this.getList()
    },
    exports() {

    },
  }
}
</script>
<style scoped>
.sq {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.table-container {
  margin-top: 20px;
}

.operate-container {
  margin-top: 20px;
}
</style>
